package com.orange.core.validator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target({ElementType.FIELD, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = PasswordValidator.class)
public @interface IsValidPassword {

    int min() default 6;

    int max() default 18;

    String message() default "密码长度需介于{min}~{max}位，并且包含英文大小写和数字";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
